From f0a9c5a30240e3020d046ac0f91b6d33af519656 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 10 Apr 2025 14:35:11 +0200 Subject: [PATCH] disable use of bulk upload for small files this feature causes many issues with impact on users so we prefer to disable it again Signed-off-by: Matthieu Gallien --- src/libsync/owncloudpropagator.cpp | 24 ++---------------------- test/testsyncengine.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index 969a8ba03..30b48ef87 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -1091,29 +1091,9 @@ Result OwncloudPropagator::staticUpdat bool OwncloudPropagator::isDelayedUploadItem(const SyncFileItemPtr &item) const { - const auto checkFileShouldBeEncrypted = [this] (const SyncFileItemPtr &item) -> bool { - const auto path = item->_file; - const auto slashPosition = path.lastIndexOf('/'); - const auto parentPath = slashPosition >= 0 ? path.left(slashPosition) : QString(); - - SyncJournalFileRecord parentRec; - bool ok = _journal->getFileRecord(parentPath, &parentRec); - if (!ok) { - return false; - } - - const auto accountPtr = account(); + Q_UNUSED(item) - if (!parentRec.isValid() || - !parentRec.isE2eEncrypted()) { - return false; - } - - return true; - }; - - return account()->capabilities().bulkUpload() && !_scheduleDelayedTasks && !item->isEncrypted() && _syncOptions.minChunkSize() > item->_size - && !isInBulkUploadBlackList(item->_file) && !checkFileShouldBeEncrypted(item); + return false; } void OwncloudPropagator::setScheduleDelayedTasks(bool active) diff --git a/test/testsyncengine.cpp b/test/testsyncengine.cpp index 21ca008f9..3d7124421 100644 --- a/test/testsyncengine.cpp +++ b/test/testsyncengine.cpp @@ -150,6 +150,8 @@ private slots: } void testDirUploadWithDelayedAlgorithm() { + QSKIP("bulk upload is disabled"); + FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()}; fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } }); @@ -181,6 +183,8 @@ private slots: } void testDirUploadWithDelayedAlgorithmWithNewChecksum() { + QSKIP("bulk upload is disabled"); + FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()}; fakeFolder.setServerVersion(QStringLiteral("32.0.0")); fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } }); @@ -1009,6 +1013,8 @@ private slots: */ void testErrorsWithBulkUpload() { + QSKIP("bulk upload is disabled"); + FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() }; fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } }); @@ -1104,6 +1110,8 @@ private slots: */ void testNetworkErrorsWithBulkUpload() { + QSKIP("bulk upload is disabled"); + FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() }; fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } }); @@ -1152,6 +1160,8 @@ private slots: void testNetworkErrorsWithSmallerBatchSizes() { + QSKIP("bulk upload is disabled"); + FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() }; fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } }); @@ -1477,6 +1487,8 @@ private slots: void testLocalInvalidMtimeCorrectionBulkUpload() { + QSKIP("bulk upload is disabled"); + const auto INVALID_MTIME = QDateTime::fromSecsSinceEpoch(0); const auto RECENT_MTIME = QDateTime::fromSecsSinceEpoch(1743004783); // 2025-03-26T16:59:43+0100 -- 2.30.2